LatLng

A geographical location which contains a single latitude, longitude pair, with optional altitude.

Latitude and longitude are expressed as decimal degrees in the WGS84 datum. By default, altitude is 0.0, or sea level.

Mapbox GL displays maps in the Mercator Projection and projects geographical data automatically, so all data enters in the WGS84 datum.

Constructors

Link copied to clipboard
fun LatLng()

Construct a new latitude, longitude point at (0, 0)

Link copied to clipboard
fun LatLng(latitude: Double, longitude: Double)

Construct a new latitude, longitude point given double arguments

Link copied to clipboard
fun LatLng(latitude: Double, longitude: Double, altitude: Double)

Construct a new latitude, longitude, altitude point given double arguments

Link copied to clipboard
fun LatLng(location: Location)

Construct a new latitude, longitude, altitude point given location argument

Link copied to clipboard
fun LatLng(latLng: LatLng)

Construct a new latitude, longitude, altitude point given another latitude, longitude, altitude point.

Link copied to clipboard
fun LatLng(in: Parcel)

Constructs a new latitude, longitude, altitude tuple given a parcel.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Link copied to clipboard
fun distanceTo(other: LatLng): Double

Calculate distance between two points

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code value for the object.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the object.

Link copied to clipboard
fun wrap(): LatLng

Return a new LatLng object with a wrapped Longitude. This allows original data object to remain unchanged.

Link copied to clipboard
open override fun writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties

Link copied to clipboard
var altitude: Double = 0.0

The altitude, in meters.

Link copied to clipboard
var latitude: Double = 0.0

The latitude, in degrees.

Link copied to clipboard
var longitude: Double = 0.0

The longitude, in degrees.